<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
  </head>
  <body>
    <ul>
      <li class="li">00001</li>
      <li class="li">00002</li>
      <li class="li">00003</li>
      <li class="li">00004</li>
      <li class="li">00005</li>
      <li class="li">00006</li>
      <li class="li">00007</li>
      <li class="li">00008</li>
      <li class="li">00009</li>
    </ul>
  </body>
  <script>
    $(function () {
      // 隔行变色
      $(".li:odd").css("background-color", "pink");
      $(".li:even").css("background-color", "yellow");
    });
  </script>
</html>
